<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <c:set var="ctx" value="${pageContext.request.contextPath }"></c:set>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<title>华阳物流</title>
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/bootstrap.min.css"/>	
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/public.css"/>
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/font-awesome.4.6.0.css"/>
		<link href="<%=request.getContextPath()%>/resources/css/foundation.min.css" rel="stylesheet" type="text/css">
		<link href="<%=request.getContextPath()%>/resources/css/foundation-datepicker.css" rel="stylesheet" type="text/css">
		
	</head>
	<body class="huayang">
		<header class="clearfix">
			<a class="navbar-brand d-inline logo2" href="#"><img src="<%=request.getContextPath()%>/resources/img/logo.png"></a>
			<a class="navbar-brand d-inline logo3" href="#"><img src="<%=request.getContextPath()%>/resources/img/1.png"></a>
		</header>
		<div class="clearfix">
			
		</div>
		<input type="hidden" id="deptid" value="${deptid }">
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <!--<a class="navbar-brand" href="#">Navbar</a>-->
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
              <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
           	
              <ul class="navbar-nav mr-auto">
              	<div class="container">       	
            	<div class="row clearfix">
              	<li id="cheng" class="nav-item active col-xs-6">
                  <a class="nav-link nav1" href="${ctx }/department/chengCity?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                <li id="mian" class="nav-item active col-xs-6">
                  <a class="nav-link nav2" href="${ctx }/department/mianCity?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                 <li id="mz" class="nav-item active col-xs-6">
                  <a class="nav-link nav6" href="${ctx }/department/mzCity?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                <li class="nav-item active col-xs-6">
                  <a class="nav-link nav3" href="${ctx }/after/showAfter?pageNow=1&&deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                <li class="nav-item active col-xs-6">
                 <a class="nav-link nav4" href="${ctx }/accountlist/selectAccountList?deptid=${deptid}&&rolename=${role.rolename}&deptname=&zhiling=&chexing=&xingming=&jiesuan=&jiashiyuanjs=&fatime1=&fatime2="><span></span></a>
                </li>
                <li class="nav-item active col-xs-6">
                  <a class="nav-link nav5" href="${ctx }/back/guanli?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
               </div>
              </div>
              </ul>
            <div class="clearfix"></div>
            <ul class="nav justify-content-center fixed-top align-middle clearfix ">
			  <li class="nav-item">
                <img class="user-img rounded-circle" src="<%=request.getContextPath()%>/resources/img/raw_1514434504.jpg"/>  
              </li>
              <li class="nav-item user-info">
                <span>${user.uname}</span>    
                <span>${role.rolename}</span> <input type="hidden" id="roleid" value="${role.roleid}">
              </li>
              <li class="nav-item pwd-change">
                <a class="nav-link active align-text-bottom" href="${ctx }/tuser/pwdjsp?deptid=${deptid}">修改密码</a>                
              </li>
              <li class="nav-item exit"> 
              	<a href="${ctx }/back/userLoginOut" onclick="return confirm('您确定要退出系统吗？');" class="nav-link active"><span class="px-3">
					<img src="<%=request.getContextPath()%>/resources/img/exit.png"></span>退出</a>     
              </li>
            </ul>
          </div>       
        </nav>	
        <div class="container-fluid content">
        	<div class="row">
        		<div class="page_position d-none d-sm-block">
        			<!--位置-->
        			<!--<div class="container-fluid pl-5">
        				<div class="row py-3">
        					<a href="#">成都</a>>>
        				</div>
        			</div>-->
        		</div>
        		
        			<div class="container-fluid  py-5 p-0">
        				<div class="row pt-xl-4 col-10">
        				   <div class="container" id="contet-box">
        				   	<!--运单登记-->
        				   	<div class="row clearfix px-5">
		                    <div class="container_form ">
			                <form action="${ctx }/waybills/updateWaybill?deptid=${deptid}" method="post" onsubmit="return yuntest()" id="fileupload" enctype="multipart/form-data" role="form" > 
		                	<input type="hidden" id="deptid" name="deptid" value="${deptid }">
		                	<input type="hidden" id="nameId" name="nameId" value="${user.uid}">
		                	<input type="hidden" id="wid" name="wid" value="${way.wid}">
			                	<div class="col-md-6 form-group input-group-one float-left">
			                	<p class="text-left">基本信息</p>
				                <div class="form-group col-md-12 column col-center-block">
							        <div class="input-group">
								        <div class="input-group-addon">始发地：</div>
                                        <%-- readonly="readonly" 只读数据--%>
                                     <input type="text"  name="wcommence" id="wcommence" value="${way.wcommence }" readonly="readonly" class="form-control" >
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">目的地：</div>
                                        <input type="text"  name="wbourn" id="wbourn" value="${way.wbourn }" readonly="readonly" class="form-control" >
							        </div>	
							        <div class="input-group">
								        <div class="input-group-addon">指令号：</div>
                                        <input type="text"  name="winstruct" id="winstruct" value="${way.winstruct }" class="form-control" >
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">车架号：</div>
                                        <input type="text"  name="wvehicle" id="wvehicle" value="${way.wvehicle }" class="form-control" >
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">车型：</div>
                                        <input type="text"  name="wvin" id="wvin" value="${way.wvin }" readonly="readonly" class="form-control" >
							        </div>
							        <%-- <div class="input-group">
								        <div class="input-group-addon">驱数：</div>
                                        <input type="text"  name="wactuate" id="wactuate" value="${way.wactuate }" readonly="readonly" class="form-control" >
							        </div> --%>
						        </div>	
			                	</div>
			                	
						        <div class="col-md-6 form-group input-group-one float-right">
						        <p class="text-left">时间信息</p>
				                <div class="form-group col-md-12 column col-center-block clearfix">
							        <div class="input-group">
								        <div class="input-group-addon">发车时间：</div>
								         <input type="hidden" id="faTime" value="${way.wdeparturetime }" >
								        <input type="text" name="wdeparturetime1" id="wdeparturetime1" placeholder="<fmt:formatDate value='${way.wdeparturetime }'   pattern="yyyy-MM-dd   HH"/>"  class="form-control timepick">
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">预计到达时间：</div>
								        <input type="hidden" id="yuTime" value="${way.westimatedtime }" >
                                        <input type="text" name="westimatedtime1" id="westimatedtime1" placeholder="<fmt:formatDate value='${way.westimatedtime }'   pattern="yyyy-MM-dd   HH"/>" class="form-control timepick">
							        </div>	
							        <div class="input-group">
								        <div class="input-group-addon">临牌到达时间：</div>
								        <input type="hidden" id="linTime" value="${way.wneartime }" >
                                        <input type="text" name="wneartime1" id="wneartime1" placeholder="<fmt:formatDate value='${way.wneartime }'   pattern="yyyy-MM-dd   HH"/>" class="form-control timepick">
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">保险到达时间：</div>
								        <input type="hidden" id="baoTime" value="${way.winsurancetime }" >
                                        <input type="text" name="winsurancetime1" id="winsurancetime1" placeholder="<fmt:formatDate value='${way.winsurancetime }'   pattern="yyyy-MM-dd   HH"/>" class="form-control timepick">
							        </div>
						        </div>	
						      
						        </div>
						        <div class="clearfix"></div>
						        <div class="form-group input-group-two clearfix">
						        	
				                <div class="form-group col-md-6 column col-center-block float-left">
				                	<p class="text-left">基本信息</p>
				                	<div class="input-group">
								        <div class="input-group-addon">驱数：</div>
                                        <input type="text"  name="wactuate" id="wactuate" value="${way.wactuate }" readonly="readonly" class="form-control" >
							        </div>
				                	<div class="input-group">
								        <div class="input-group-addon">运送驾驶员：</div>
                                        <input type="text"  name="wtransport" id="wtransport" value="${way.wtransport }" readonly="readonly" class="form-control" >
							        </div>
							        <div id="changjia" class="input-group">
								        <div class="input-group-addon">厂家结算：</div>
                                        <input type="text"  name="wfactory" id="wfactory" value="${way.wfactory }" readonly="readonly" class="form-control" >
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">驾驶员结算：</div>
                                        <input type="text"  name="wpilot" id="wpilot" value="${way.wpilot }" readonly="readonly" class="form-control" >
							        </div>
							        
							        <%-- <div class="input-group">
								        <div class="input-group-addon">商业险金额：</div>
								        <input type="text" name="wcommercial" id="wcommercial" value="${way.wcommercial }" onkeyup="IWS_CheckDecimal(this)" class="form-control">
							        </div> --%>
							      
						        </div>
						        <div class="form-group col-md-6 column col-center-block float-right">			                	
							        <p class="text-left">基本信息</p>
							        <div class="input-group">
								        <div class="input-group-addon">商业险金额：</div>
								        <input type="text" name="wcommercial" id="wcommercial" value="${way.wcommercial }" onkeyup="IWS_CheckDecimal(this)" class="form-control">
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">强险金额：</div>
								        <input type="text" name="wcoerce" id="wcoerce" value="${way.wcoerce }" onkeyup="QIANG_CheckDecimal(this)" class="form-control">
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">临牌金额：</div>
								        <input type="text" name="wamount" id="wamount" value="${way.wamount }" onkeyup="LIN_CheckDecimal(this)" class="form-control">
							        </div>
							        <div class="input-group">
								        <div class="input-group-addon">备注信息：</div>
								        <textarea name="wremark" class="form-control"  rows="1">${way.wremark }</textarea>
							        </div>
							       
						        </div>
						        

						        </div>
						        
						       <div class="clearfix">
						       	
						       </div>
						        <div class="column col-center-block">
						        	
						        
				                <div class="form-group detail-button" style="padding-bottom: 90px;">
					                <div class="float-left">
						               <button type="submit" class="btn btn-default">提交</button>
						            </div>
                                    <div class="float-right">
                                       <button type="button" class="btn btn-default" onClick="history.back()">取消</button>
                                    </div>
				                </div>
				                </div>
			                </form>
		                </div>          
		            </div>
        				   	<!--运单登记-->
        					</div>
        				</div>       				
        			</div>
        		</div>
        	</div> 
		 <script src="<%=request.getContextPath()%>/resources/js/jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="<%=request.getContextPath()%>/resources/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="<%=request.getContextPath()%>/resources/js/foundation-datepicker.js" type="text/javascript" charset="utf-8"></script>
        	<!--推送消息-->
        	
        		<jsp:include page="munetab.jsp" />
        	
	</body>
	<script type="text/javascript">
		$(document).ready(function(){ 
				  var deptid = document.getElementById("deptid").value;
					if(deptid==1){
						$("#cheng").addClass("current"); 
					 
					}
					if(deptid==2){
						
					   $("#mian").addClass("current"); 
					 
					}
					if(deptid==4){
						
					   $("#mz").addClass("current"); 
					 
					}
			}); 
	</script>
	<script type="text/javascript">
			function IWS_CheckDecimal(wcommercial) {
			    var temp = /^\d+\.?\d{0,2}$/;
			    var wcommercial = document.getElementById("wcommercial").value;
			    if (!temp.test(wcommercial)) {
			    	alert("请输入商业险正确金额!");
			    	return false;
			    }
			    
			}
			
			function QIANG_CheckDecimal(wcoerce){
			var wcoerce = document.getElementById("wcoerce").value;
				if (!/^\d+\.?\d{0,2}$/.test(wcoerce)) {
			    	alert("请输入强险正确金额!");
			    	return false;
			    }
			}
			
			function LIN_CheckDecimal(wamount){
			var wamount = document.getElementById("wamount").value;
				if (!/^\d+\.?\d{0,2}$/.test(wamount)) {
			    	alert("请输入临牌正确金额!");
			    	return false;
			    }
			}
	
	
	</script>
	<script type="text/javascript">
		jeDate({
			dateCell : "#wdeparturetime1",
			format : "YYYY-MM-DD hh:mm:ss",
			isinitVal : false,
			isTime : true, //isClear:false,
			minDate : "2000-01-01 00:00:00",
			maxDate : "2299-12-30 00:00:00",
			okfun : function(val) {
				alert(val);
			}
		})
		jeDate({
			dateCell : "#westimatedtime1",
			format : "YYYY-MM-DD hh:mm:ss",
			isinitVal : false,
			isTime : true, //isClear:false,
			minDate : "2000-01-01 00:00:00",
			maxDate : "2299-12-30 00:00:00",
			okfun : function(val) {
				alert(val);
			}
		})
		jeDate({
			dateCell : "#wneartime1",
			format : "YYYY-MM-DD hh:mm:ss",
			isinitVal : false,
			isTime : true, //isClear:false,
			minDate : "2000-01-01 00:00:00",
			maxDate : "2299-12-30 00:00:00",
			okfun : function(val) {
				alert(val);
			}
		})
		jeDate({
			dateCell : "#winsurancetime1",
			format : "YYYY-MM-DD hh:mm:ss",
			isinitVal : false,
			isTime : true, //isClear:false,
			minDate : "2000-01-01 00:00:00",
			maxDate : "2299-12-30 00:00:00",
			okfun : function(val) {
				alert(val);
			}
		})
	</script>
	
	<script type="text/javascript">
		$('.timepick').fdatepicker({
			format: 'yyyy-mm-dd hh',
			pickTime: 1,
		});
	</script>
	
	<script type="text/javascript">

		!function(){
		
			laydate.skin('dahong');//切换皮肤，请查看skins下面皮肤库
		
			laydate({elem: '#demo'});
			laydate({elem: '#demo1'});
			laydate({elem: '#demo2'});
			laydate({elem: '#demo3'});//绑定元素
			//绑定元素
		
		}();
		
		
		
		//日期范围限制
		
		var start = {
		
		    elem: '#start',
		
		    format: 'YYYY-MM-DD',
		
		    min: laydate.now(), //设定最小日期为当前日期
		
		    max: '2099-06-16', //最大日期
		
		    istime: true,
		
		    istoday: false,
		
		    choose: function(datas){
		
		         end.min = datas; //开始日选好后，重置结束日的最小日期
		
		         end.start = datas //将结束日的初始值设定为开始日
		
		    }
		
		};
		
		
		
		var end = {
		
		    elem: '#end',
		
		    format: 'YYYY-MM-DD',
		
		    min: laydate.now(),
		
		    max: '2099-06-16',
		
		    istime: true,
		
		    istoday: false,
		
		    choose: function(datas){
		
		        start.max = datas; //结束日选好后，充值开始日的最大日期
		
		    }
		
		};
		
		laydate(start);
		
		laydate(end);
		
		
	</script>
	<script type="text/javascript">
		function yuntest(){
			
	    	/* var wvehicle = document.getElementById("wvehicle").value;
	    	if(wvehicle==null||wvehicle==""||wvehicle==undefined){
				alert("请输入车架号");
				return false;
			} */
			
			var faTime = document.getElementById("faTime").value;
			if(faTime==null||faTime==""||faTime==undefined){
				var wdeparturetime = document.getElementById("wdeparturetime1").value;
		    	if(wdeparturetime==null||wdeparturetime==""||wdeparturetime==undefined){
					alert("请选择发车时间");
					return false;
				}
			}else{
				return true;
			}
			
			var yuTime = document.getElementById("yuTime").value;
			if(yuTime==null||yuTime==""||yuTime==undefined){
				var westimatedtime = document.getElementById("westimatedtime1").value;
		    	if(westimatedtime==null||westimatedtime==""||westimatedtime==undefined){
				alert("请选择预计到达时间");
				return false;
			}
			}else{
				return true;
			}
	    	var linTime = document.getElementById("linTime").value;
			if(linTime==null||linTime==""||linTime==undefined){
				var wneartime = document.getElementById("wneartime1").value;
		    	if(wneartime==null||wneartime==""||wneartime==undefined){
					alert("请选择临牌到达时间");
					return false;
				}
			}else{
				return true;
			}
	    	var baoTime = document.getElementById("baoTime").value;
			if(baoTime==null||baoTime==""||baoTime==undefined){
				var winsurancetime = document.getElementById("winsurancetime1").value;
		    	if(winsurancetime==null||winsurancetime==""||winsurancetime==undefined){
					alert("请选择保险到达时间");
					return false;
				}
			}else{
				return true;
			}
	    	
	    	
	    	var wcommercial = document.getElementById("wcommercial").value;
	    	if(wcommercial==null||wcommercial==""||wcommercial==undefined){
				alert("请输入商业险金额（元）");
				return false;
			}
			if (!/^\d+\.?\d{0,2}$/.test(wcommercial)) {
			    	alert("请输入商业险正确金额!");
			    	return false;
			    }
	    	var wcoerce = document.getElementById("wcoerce").value;
	    	if(wcoerce==null||wcoerce==""||wcoerce==undefined){
				alert("请输入强险金额（元）");
				return false;
			}
			if (!/^\d+\.?\d{0,2}$/.test(wcoerce)) {
			    	alert("请输入强险正确金额!");
			    	return false;
			    }
	    	var wamount = document.getElementById("wamount").value;
			if(wamount==null||wamount==""||wamount==undefined){
				alert("请输入临牌金额（元）");
				return false;
			}
			if (!/^\d+\.?\d{0,2}$/.test(wamount)) {
			    	alert("请输入临牌正确金额!");
			    	return false;
			    	
			    }
	    	
		}
	</script>
	
	<script type="text/javascript"> 
		   window.onload=function(){ 
				var action ='<%=request.getAttribute("result")%>';
				if(action.length!==4)
				{
						alert(action);
				}
			} 
		</script>
</html>
